package br.com.perkins.myproject.presentation;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

@Controller
@Scope("request")
public class AdminController {

	@Resource
	private MenuCrudController menuCrudController;
	@Resource
	private SubmenuCrudController submenuCrudController;

	private String menuOption;
	public String getMenuOption() {
		return menuOption;
	}
	public void setMenuOption(String menuOption) {
		this.menuOption = menuOption;
	}

	public String doForward() {
		if (menuOption.equals("gerenciarMenus")) {
			menuCrudController.setFirstTime();
			return "gerenciarMenus";
		}
		if (menuOption.equals("gerenciarSubmenus")) {
			return "gerenciarSubmenus";
		}
		return null;
	}

}